<template>
	<div class="app">
		<h2>{{ message }}</h2>
		<home></home>
		<button @click="isShowCategory = !isShowCategory">是否显示Category</button>
		<category v-if="!isShowCategory"></category>
	</div>
</template>

<script>
import eventBus from './utils/event-bus'
import Home from './components/Home.vue'
import Category from './components/Category.vue'

export default {
	components: {
		Home,
		Category,
	},
	data() {
		return {
			message: 'hello App',
			isShowCategory: false,
		}
	},
	created() {
		eventBus.on('why', (name, age, height) => {
			console.log('name, age, height: ', name, age, height)
			this.message = `name: ${name}, age: ${age}, height: ${height}`
		})
	},
}
</script>

<style scoped></style>
